/*
 * @Author: your name
 * @Date: 2021-08-31 19:10:21
 * @LastEditTime: 2021-08-31 19:32:21
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day07\7-重写数组some.js
 */

//some 某一个  某一个满足条件为true,否则为false

//重写some  
Array.prototype.mySome = function(fn) {
    //var arr=this
    for (i = 0; i < this.length; i++) {
        var bool = fn(this[i], i, this);
        if (bool) { return true; }
    }
    return false;
};
//定义数组
var arr = [100, 80, 20, 200, 150];
//判断条件
function fn(value, index, arr) {
    return value > 200;
}
//调用函数
var r1 = arr.mySome(fn);
//打印结果
console.log(r1);